package com.cbank.controller.homepage;

import com.cbank.domain.Module;
import com.cbank.service.ModuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/home/module")
public class HomeModuleController {
    @Autowired
    private ModuleService moduleService;

    /**
     * 获取页面的导航信息
     * @return
     */
    @RequestMapping("/all")
    public String getAll(Model model){
        List<Module> moduleList=this.moduleService.getAll();
        model.addAttribute("moduleList",moduleList);
        return "";
    }
}
